﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace Three_Red_Dragon_Mvc.Controllers
{
    /// <summary>
    /// 物料需求计划控制器
    /// </summary>
    public class PlanController : Controller
    {
        private readonly IpAddressesConfig _ipAddressesConfig;
        public PlanController(IOptions<IpAddressesConfig> ipAddressesConfig)
        {
            _ipAddressesConfig = ipAddressesConfig.Value;
        }
        /// <summary>
        /// 计划添加视图
        /// </summary>
        /// <returns>返回视图</returns>
        public IActionResult PlanCreate()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
        /// <summary>
        /// 计划显示视图
        /// </summary>
        /// <returns>返回视图</returns>
        public IActionResult PlanSearch()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
        /// <summary>
        /// 计划修改视图
        /// </summary>
        /// <returns>返回视图</returns>
        public IActionResult PlanUpdate()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
    }
}
